import java.util.Arrays;
public class Mysort {
    public static void main(String[] args) {
        String[] toSort = {"aaa:10:1:1",
                "ccc:30:3:4",
                "bbb:50:4:5",
                "ddd:20:5:3",
                "eee:40:2:20"};
        int[] tmp=new int [toSort.length];
        for(int i=0;i<toSort.length;i++)
        {
            //String str1=String.join(",",toSort[i].split("\\:"));
            tmp[i]=Integer.parseInt(toSort[i].split("\\:")) ;
        }
        System.out.println("Before sort:");
        for (String str : toSort)
            System.out.println(str);
        Arrays.sort(tmp);
        System.out.println("After sort:");
        /*for (String str : toSort)
            System.out.println(str);*/
        for(int i=0;i<toSort.length;i++)
            for(int j=0;j<toSort.length;j++)
                if(toSort[i].equals(toSort[j])) System.out.println(toSort[j]);
    }
}
